﻿@{
    ViewBag.Title = "类目管理";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<style>
    .margin-left1 {
        padding-left: 00px;
        font-weight: bold;
        font-size: 14px;
    }

    .margin-left2 {
        padding-left: 30px;
        font-weight: bold;
        font-size: 12px;
    }

    .margin-left3 {
        padding-left: 60px;
        font-size: 12px;
    }
</style>
@model List<UcAsp.Net.Model.Select>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span11"></div>
        <div class="span11">
            <button id="addcontent" class="btn btn-danger" data-id="@ViewData["ParentID"]">
                添加
            </button>
        </div>
        <div class="span11">
            <div id="breadcrumb">
                @foreach (UcAsp.Net.Model.CategoriesTree tree in (List<UcAsp.Net.Model.CategoriesTree>)ViewData["Categories"])
                {
                    <a href="CategoriesManger?ID=@tree.ID" class="tip-bottom">@tree.CategorieName</a>
                }
            </div>
            </div>
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <h5>
                        类目管理
                    </h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>
                                    类目名称
                                </th>
                                <th>
                                    路径
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (UcAsp.Net.Model.Select art in Model)
                            {
                                <tr>
                                    <td>
                                        <div class="margin-left@{@art.Depth}">
                                            <a href="/Admin/CategoriesManger?ID=@art.Value">@art.Name</a>
                                        </div>
                                    </td>
                                    <td>
                                        @art.ShowPath
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button class="btn btn-primary artedit" data-id="@art.Value">
                                                <i class="icon-pencil icon-white"></i>编辑
                                            </button>
                                            <button class="btn btn-primary setting" data-id="@art.Value">
                                                <i class="icon-road icon-white"></i>设置项目
                                            </button>
                                            <a class="btn btn-primary more" href="/admin/SetFiledManger?CID=@art.Value" data-id="@art.Value">
                                                <i class=" icon-signal icon-white">
                                                </i>详细项目
                                            </a> <a class="btn btn-primary articel" href="/admin/Articles?CID=@art.Value">
                                                <i class=" icon-signal icon-white"></i>文章列表
                                            </a>
                                            <a class="btn btn-primary" href="/Admin/ArticlesManager?CID=@art.Value">
                                                <i class=" icon-signal icon-white">
                                                </i>添加内容
                                            </a>

                                            <button class="btn btn-danger delete" data-id="@art.Value">
                                                <i class="icon-remove icon-white"></i>删除
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        ///修改分类信息
        $(".artedit").click(function () {
            $.get("/Admin/EditCategories?ID=" + $(this).attr("data-id")+"&ParentID="+@ViewData["ParentID"], function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");

            });
        })
        ///设置项目
        $(".setting").click(function () {
            $.get("/Admin/EditSetFiled?CID=" + $(this).attr("data-id"), function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");
            });
        })

        ///设置详细设置
        $(".more").click(function () {
            $.get("/Admin/SetFiledManger?CID=" + $(this).attr("data-id"), function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");

            });
        })

        $("#addcontent").click(function () {
            $.get("/Admin/EditCategories?ParentID=" + $(this).attr("data-id"), function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");

            });
        })
        $(".delete").click(function () {
            $.get("/Admin/CategoriesDelete?ID=" + $(this).attr("data-id"), function (dataResult) {
                location.reload();

            });
        })
    });
</script>
